<template>
  <div>
    <home-header></home-header>
    <home-nav :nav="nav"></home-nav>
  </div>
</template>

<script type="text/javascript">
import HomeHeader from 'pages/home/components/Header'
import HomeNav from 'pages/home/components/Nav'
import axios from 'axios'

export default {
  name: 'Home',
  components: {
    HomeHeader,
    HomeNav
  },
  data () {
  	return {
  		nav: []
  	}
  },
  methods: {
    getHomeNav () {
      axios.get('/static/nav.json')
        .then(this.getHomeNavSucc)
    },
    getHomeNavSucc (res) {
    	res = res.data
    	if (res.ret && res.data) {
    		const data = res.data
    		this.nav = data.navList
    	}
    }
  },
  mounted () {
    this.getHomeNav()
  }
}
</script>

<style type="stylus" scoped></style>
